/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package peticionweb.logica.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author icardenas
 */
@Entity
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cupar1a.findAll", query = "SELECT c FROM Cupar1a c")})
public class Cupar1a implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected Cupar1aPK cupar1aPK;
    @Basic(optional = false)
    @Column(nullable = false)
    private int pospa;
    @Basic(optional = false)
    @Column(nullable = false)
    private char estpa;
    @Basic(optional = false)
    @Column(nullable = false)
    private char es1pa;
    @Basic(optional = false)
    @Column(nullable = false)
    private char minpa;
    @Basic(optional = false)
    @Column(nullable = false)
    private long nexpa;
    @Basic(optional = false)
    @Column(nullable = false)
    private long nprpa;
    @JoinColumn(name = "ideye", referencedColumnName = "ideye", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cuyea1m cuyea1m;
    @JoinColumn(name = "cidpe", referencedColumnName = "cidpe", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cuper1m cuper1m;
    @JoinColumn(name = "codca", referencedColumnName = "codca", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cucar1m cucar1m;

    public Cupar1a() {
    }

    public Cupar1a(Cupar1aPK cupar1aPK) {
        this.cupar1aPK = cupar1aPK;
    }

    public Cupar1a(Cupar1aPK cupar1aPK, int pospa, char estpa, char es1pa, long nexpa, long nprpa) {
        this.cupar1aPK = cupar1aPK;
        this.pospa = pospa;
        this.estpa = estpa;
        this.es1pa = es1pa;
        this.nexpa = nexpa;
        this.nprpa = nprpa;
    }

    public Cupar1a(int codca, String ideye, String cidpe) {
        this.cupar1aPK = new Cupar1aPK(codca, ideye, cidpe);
    }

    public Cupar1aPK getCupar1aPK() {
        return cupar1aPK;
    }

    public void setCupar1aPK(Cupar1aPK cupar1aPK) {
        this.cupar1aPK = cupar1aPK;
    }

    public int getPospa() {
        return pospa;
    }

    public void setPospa(int pospa) {
        this.pospa = pospa;
    }

    public char getEstpa() {
        return estpa;
    }

    public void setEstpa(char estpa) {
        this.estpa = estpa;
    }

    public char getEs1pa() {
        return es1pa;
    }

    public void setEs1pa(char es1pa) {
        this.es1pa = es1pa;
    }

    public long getNexpa() {
        return nexpa;
    }

    public void setNexpa(long nexpa) {
        this.nexpa = nexpa;
    }

    public long getNprpa() {
        return nprpa;
    }

    public void setNprpa(long nprpa) {
        this.nprpa = nprpa;
    }

    public Cuyea1m getCuyea1m() {
        return cuyea1m;
    }

    public void setCuyea1m(Cuyea1m cuyea1m) {
        this.cuyea1m = cuyea1m;
    }

    public Cuper1m getCuper1m() {
        return cuper1m;
    }

    public void setCuper1m(Cuper1m cuper1m) {
        this.cuper1m = cuper1m;
    }

    public Cucar1m getCucar1m() {
        return cucar1m;
    }

    public void setCucar1m(Cucar1m cucar1m) {
        this.cucar1m = cucar1m;
    }

    public char getMinpa() {
        return minpa;
    }

    public void setMinpa(char minpa) {
        this.minpa = minpa;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cupar1aPK != null ? cupar1aPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cupar1a)) {
            return false;
        }
        Cupar1a other = (Cupar1a) object;
        if ((this.cupar1aPK == null && other.cupar1aPK != null) || (this.cupar1aPK != null && !this.cupar1aPK.equals(other.cupar1aPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "peticionweb.logica.entidad.Cupar1a[ cupar1aPK=" + cupar1aPK + " ]";
    }
    
}
